<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        /* 采用后代选择器给p元素设置背景颜色 */
        .main p {
            background: skyblue;
            color: red;
        }

        /* 选取到了main下的所以p元素 */

        ul li {
            /* 去除无序列表的小圆点 */
            list-style: none;
            color: palevioletred;
        }

        ul li a {
            color: #000;
            text-decoration: none;
        }
    </style>
</head>

<body>
    <div class="main">
        这是div元素
        <p>段落</p>
        <div>
            <p>这是孙p元素</p>
        </div>
    </div>
    <!-- 效果a1-a3运用一样的字体颜色 -->
    <ul>
        <li><a href="">a1</a><span>sp1</span></li>
        <li><a href="">a2</a><span>sp2</span></li>
        <li><a href="">a3</a><span>sp3</span></li>
    </ul>
</body>

</html>